<?php
require(dirname(__FILE__)."/../../inc/common.inc.php");
admin(18);
$uadmin=$db->get_one("SELECT * FROM {$pre}admin where u_id='$admin_id'");

$list1=trim($adminarr['u_lanid'],',');
if($adminarr['u_group']!=1){
    $isql2.=" and a.u_gid in ($list1) ";
}
?>
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="../js/html5.js"></script>
    <script type="text/javascript" src="../js/respond.min.js"></script>
    <script type="text/javascript" src="../js/PIE_IE678.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="../css/H-ui.css"/>
    <link type="text/css" rel="stylesheet" href="../css/H-ui.admin.css"/>
    <link type="text/css" rel="stylesheet" href="../font/font-awesome.min.css"/>
    <!--[if IE 7]>
    <link href="../font/font-awesome-ie7.min.css" rel="stylesheet" type="text/css" />
    <![endif]-->
    <title>管理员列表</title>
</head>
<body>
<?php
function ttre($str){
    if (!$str){
        return '0';
    }else{
        return $str;
    }
}


if (!empty($subit)){

    $where = [
        "activity_route" => $activity_route,
        "content" => $content,
        "activity_location" => $activity_location,
        "activity_time" => $activity_time,
        "location" => $location,
        "add_time" => date("Y-m-d H:i"),
    ];

    if(empty($uid)){
        $where = add_str($where);
        $db->query( " INSERT INTO `chen_activity` set {$where} " );
        logo('添加活动');
        refreshto("activity.php",'添加成功!',2);
    }else{
        unset($where['add_time']);
        $where = add_str($where);
        $db->query( "update `chen_activity` set {$where} where id='{$uid}' " );
        logo('修改活动');
        refreshto("activity.php",'修改成功!',2);
    }
}

if(!empty($uid)){
    $dbrs = $db->get_one( "select * from {$pre}activity where id = '{$uid}' " );
    if(!$dbrs){
        showerr("err");
    }
}


?>
<div class="pd-20">
    <div class="Huiform">
        <table class="table table-border table-bordered table-bg">
            <form name="zhuce12"  method="post" target="_parent" >
                <input type="hidden" name="backurl" value="<?=$backurl?>">
                <input type="hidden" name="uid" value="<?= $uid?>">
                <tr>
                    <td width="20%" height="25" align="right" bgcolor="#FFFFFF" class="bgcolor">活动时间：</td>
                    <td width="80%" height="25" bgcolor="#FFFFFF" class="bgcolor">
                        <input class="input-text" type="text" name="activity_time"  value="<?=$dbrs['activity_time']?>" />
                    </td>
                </tr>
                <tr>
                    <td height="25" align="right" bgcolor="#FFFFFF" class="bgcolor">活动地点：</td>
                    <td height="25" bgcolor="#FFFFFF" class="bgcolor">
                        <input class="input-text" type="text" name="activity_location" value="<?= $dbrs['activity_location']?>">
                    </td>
                </tr>

                <tr>
                    <td width="20%" height="25" align="right" bgcolor="#FFFFFF" class="bgcolor">活动路线：</td>
                    <td width="80%" height="25" bgcolor="#FFFFFF" class="bgcolor">
                        <input class="input-text" type="text" name="activity_route"  value="<?=$dbrs['activity_route']?>" />
                    </td>
                </tr>
                <tr>
                    <td width="20%" height="25" align="right" bgcolor="#FFFFFF" class="bgcolor">活动大致内容及意义：</td>
                    <td width="80%" height="25" bgcolor="#FFFFFF" class="bgcolor">
                        <textarea name="content" class="textarea"  rows="5"><?=$dbrs['content']?></textarea>
                    </td>
                </tr>
                <tr>
                    <td width="20%" height="25" align="right" bgcolor="#FFFFFF" class="bgcolor">所在地址：</td>
                    <td width="80%" height="25" bgcolor="#FFFFFF" class="bgcolor">
                        <input class="input-text" type="text" name="location"  value="<?=$dbrs['location']?>" />
                    </td>
                </tr>

                <tr>
                    <td height="25" colspan="2" align="center" bgcolor="#FFFFFF" class="bgcolor"><input type="submit" name="subit" value="<?php if ($uid){?>修改<?php } else{?>添加<?php }?>" class="btn btn-success radius"  /></td>
                </tr>
            </form>
        </table>

        <script type="text/javascript" src="../js/jquery.min.js"></script>
        <script type="text/javascript" src="../js/Validform_v5.3.2_min.js"></script>
        <script type="text/javascript" src="../layer/layer.min.js"></script>
        <script type="text/javascript" src="../js/H-ui.js"></script>
        <script type="text/javascript" src="../js/H-ui.admin.js"></script>
        <script type="text/javascript">
            $(".Huiform").Validform();
        </script>

</body>
</html>
